<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<link rel="icon" type="image/ico" href="images/favicon.ico"></link> 
	<link rel="shortcut icon" href="images/favicon.ico"></link>
	<link rel="stylesheet" type="text/css" href="styles.css">
	<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
	<title>Recibidos</title>
</head>
<body style="margin: 0 auto;width: 68%; background-color: silver;">
	<div id="contenedor">
		<h1>Recibidos</h1>
		<div id="boton_redactar">
			<a href="redactarEmail?to=null">Redactar</a>
		</div>
		<div id="boton_enviados">
			<a href="redirectAdmin?to=enviados">Enviados</a>
		</div>
		<div id="tabla_inbox">
			<table width="100%" cellpadding="5" bordercolor="#000066" 
			  			bgcolor="#FFFFFF" border="1" cellspacing="0">
			  			 <tr>
		                    <th></th>
		                    <th>Remitente</th>
		                    <th>Asunto</th>
		                    <th>Fecha</th>
		                    <th><form method="POST" action="eliminarEmail?id=0">
						 			<input type="submit" value="Borrar Todos"/>
								</form>
							</th>
				         </tr>
				         <c:forEach var="email" items="${emails}">
					         <tr>
					         			<td><form method="POST" action="detalleEmail?id=${email.id}">
						 						<input type="submit" value="Ver"/>
											</form>
										</td>
					                    <td><c:out value="${email.remitente}"/></td>
					                    <td><c:out value="${email.asunto}" /></td>
					                    <td><c:out value="${email.fecha}" /></td>
					                    <td><form method="POST" action="eliminarEmail?id=${email.id}">
						 						<input type="submit" value="Eliminar"/>
											</form>
										</td>
					         </tr>
				     	</c:forEach>
			</table>
		</div>
	</div>
</body>
</html>